home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1995 March / PC Plus Super CD (Issue 101) (March 1995).iso / tclite / include / list.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-27  |  1.8 KB  |  50 lines

  1. #ifndef    LINKEDLIST_H
  2. #define    LINKEDLIST_H
  3.  
  4. #include "seqcltn.h"
  5. #include "link.h"
  6.  
  7. extern const Class class_LinkedList;
  8.  
  9. class LinkedList : public SeqCltn {
  10.     Link* firstLink;    // pointer to first Link of list 
  11.     Link* lastLink;        // pointer to last Link of list 
  12.     unsigned count;        // count of items on list 
  13.     void errDblLnk(const char* fn, const Link& lnk) const;
  14.     void errEmpty(const char* fn) const;
  15.     void errNotFound(const char* fn, const Object& ob) const;
  16. public:
  17.     LinkedList();
  18.     bool operator!=(const LinkedList& a) const   { return !(*this==a); }
  19.     bool operator==(const LinkedList&) const;
  20.     Object*& operator[](int i) const;
  21.     virtual Object* add(const Object&);
  22.     virtual Collection& addContentsTo(Collection& cltn) const;
  23.     virtual Object* addFirst(const Object& ob);
  24.     virtual Object* addLast(const Object& ob);
  25.     virtual Object*& at(int i) const;
  26.     virtual void atAllPut(const Object& ob);
  27.     virtual void deepenShallowCopy();
  28.     virtual Object* doNext(Iterator&) const;
  29.     virtual Object* first() const;
  30.     virtual unsigned hash() const;
  31.     virtual int indexOf(const Object& ob) const;
  32.     virtual int indexOfSubCollection(const SeqCltn& cltn, int start=0) const;
  33.     virtual const Class* isA() const;
  34.     virtual bool isEmpty()  const;
  35.     virtual bool isEqual(const Object&) const;
  36.     virtual Object* last() const;
  37.     virtual unsigned occurrencesOf(const Object&) const;
  38.     virtual void printOn(ostream& strm) const;
  39.     virtual Object* remove(const Object&);
  40.     virtual Object* removeFirst();
  41.     virtual Object* removeLast();
  42.     virtual void replaceFrom(int start, int stop,
  43.                              const SeqCltn& replacement, int startAt =0);
  44.     virtual void reSize(unsigned newSize);
  45.     virtual unsigned size() const;
  46.     virtual const Class* species() const;
  47. };
  48.  
  49. #endif
  50.